/*
 * Title:        CloudScheduler Toolkit
 * Description:  a Toolkit for Modeling and Simulation of Job Scheduling and Resource Provisioning in Cloud System
 * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
 * Author:       Fuhui Wu
 *
 * Copyright (c) 2013-2014, The National University of Defense Technology, China
 */

package org.nudt.jCloud.simulation;

import org.nudt.jCloud.infrastructure.Slot;
import org.nudt.jCloud.workload.Task;

public class TaskExecution {
	public static double execution(Task task, Slot slot){
		if(task.getBlock()==null){
			return task.getDuration();
		}else{
			if(task.getBlock().locality(slot)){
				return task.getDuration();
			}else{
				return task.getDuration()*2;
			}
		}		
	}

}
